package com.liyao.protobuf.test.service;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.40.1)",
    comments = "Source: mykey.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class MyServiceGrpc {

  private MyServiceGrpc() {}

  public static final String SERVICE_NAME = "com.liyao.MyService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetByKey",
      requestType = com.liyao.protobuf.test.service.MyRequest.class,
      responseType = com.liyao.protobuf.test.service.MyResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyMethod() {
    io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse> getGetByKeyMethod;
    if ((getGetByKeyMethod = MyServiceGrpc.getGetByKeyMethod) == null) {
      synchronized (MyServiceGrpc.class) {
        if ((getGetByKeyMethod = MyServiceGrpc.getGetByKeyMethod) == null) {
          MyServiceGrpc.getGetByKeyMethod = getGetByKeyMethod =
              io.grpc.MethodDescriptor.<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetByKey"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MyServiceMethodDescriptorSupplier("GetByKey"))
              .build();
        }
      }
    }
    return getGetByKeyMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyServerStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetByKeyServerStream",
      requestType = com.liyao.protobuf.test.service.MyRequest.class,
      responseType = com.liyao.protobuf.test.service.MyResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyServerStreamMethod() {
    io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse> getGetByKeyServerStreamMethod;
    if ((getGetByKeyServerStreamMethod = MyServiceGrpc.getGetByKeyServerStreamMethod) == null) {
      synchronized (MyServiceGrpc.class) {
        if ((getGetByKeyServerStreamMethod = MyServiceGrpc.getGetByKeyServerStreamMethod) == null) {
          MyServiceGrpc.getGetByKeyServerStreamMethod = getGetByKeyServerStreamMethod =
              io.grpc.MethodDescriptor.<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetByKeyServerStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MyServiceMethodDescriptorSupplier("GetByKeyServerStream"))
              .build();
        }
      }
    }
    return getGetByKeyServerStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyClientStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetByKeyClientStream",
      requestType = com.liyao.protobuf.test.service.MyRequest.class,
      responseType = com.liyao.protobuf.test.service.MyResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyClientStreamMethod() {
    io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse> getGetByKeyClientStreamMethod;
    if ((getGetByKeyClientStreamMethod = MyServiceGrpc.getGetByKeyClientStreamMethod) == null) {
      synchronized (MyServiceGrpc.class) {
        if ((getGetByKeyClientStreamMethod = MyServiceGrpc.getGetByKeyClientStreamMethod) == null) {
          MyServiceGrpc.getGetByKeyClientStreamMethod = getGetByKeyClientStreamMethod =
              io.grpc.MethodDescriptor.<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetByKeyClientStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MyServiceMethodDescriptorSupplier("GetByKeyClientStream"))
              .build();
        }
      }
    }
    return getGetByKeyClientStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyBiStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetByKeyBiStream",
      requestType = com.liyao.protobuf.test.service.MyRequest.class,
      responseType = com.liyao.protobuf.test.service.MyResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest,
          com.liyao.protobuf.test.service.MyResponse> getGetByKeyBiStreamMethod() {
    io.grpc.MethodDescriptor<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse> getGetByKeyBiStreamMethod;
    if ((getGetByKeyBiStreamMethod = MyServiceGrpc.getGetByKeyBiStreamMethod) == null) {
      synchronized (MyServiceGrpc.class) {
        if ((getGetByKeyBiStreamMethod = MyServiceGrpc.getGetByKeyBiStreamMethod) == null) {
          MyServiceGrpc.getGetByKeyBiStreamMethod = getGetByKeyBiStreamMethod =
              io.grpc.MethodDescriptor.<com.liyao.protobuf.test.service.MyRequest, com.liyao.protobuf.test.service.MyResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetByKeyBiStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.liyao.protobuf.test.service.MyResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MyServiceMethodDescriptorSupplier("GetByKeyBiStream"))
              .build();
        }
      }
    }
    return getGetByKeyBiStreamMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static MyServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<MyServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<MyServiceStub>() {
        @Override
        public MyServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new MyServiceStub(channel, callOptions);
        }
      };
    return MyServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static MyServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<MyServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<MyServiceBlockingStub>() {
        @Override
        public MyServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new MyServiceBlockingStub(channel, callOptions);
        }
      };
    return MyServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static MyServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<MyServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<MyServiceFutureStub>() {
        @Override
        public MyServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new MyServiceFutureStub(channel, callOptions);
        }
      };
    return MyServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class MyServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void getByKey(com.liyao.protobuf.test.service.MyRequest request,
                         io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetByKeyMethod(), responseObserver);
    }

    /**
     */
    public void getByKeyServerStream(com.liyao.protobuf.test.service.MyRequest request,
                                     io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetByKeyServerStreamMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyRequest> getByKeyClientStream(
        io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetByKeyClientStreamMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyRequest> getByKeyBiStream(
        io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetByKeyBiStreamMethod(), responseObserver);
    }

    @Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getGetByKeyMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                      com.liyao.protobuf.test.service.MyRequest,
                      com.liyao.protobuf.test.service.MyResponse>(
                  this, METHODID_GET_BY_KEY)))
          .addMethod(
            getGetByKeyServerStreamMethod(),
            io.grpc.stub.ServerCalls.asyncServerStreamingCall(
              new MethodHandlers<
                      com.liyao.protobuf.test.service.MyRequest,
                      com.liyao.protobuf.test.service.MyResponse>(
                  this, METHODID_GET_BY_KEY_SERVER_STREAM)))
          .addMethod(
            getGetByKeyClientStreamMethod(),
            io.grpc.stub.ServerCalls.asyncClientStreamingCall(
              new MethodHandlers<
                      com.liyao.protobuf.test.service.MyRequest,
                      com.liyao.protobuf.test.service.MyResponse>(
                  this, METHODID_GET_BY_KEY_CLIENT_STREAM)))
          .addMethod(
            getGetByKeyBiStreamMethod(),
            io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
              new MethodHandlers<
                      com.liyao.protobuf.test.service.MyRequest,
                      com.liyao.protobuf.test.service.MyResponse>(
                  this, METHODID_GET_BY_KEY_BI_STREAM)))
          .build();
    }
  }

  /**
   */
  public static final class MyServiceStub extends io.grpc.stub.AbstractAsyncStub<MyServiceStub> {
    private MyServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected MyServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new MyServiceStub(channel, callOptions);
    }

    /**
     */
    public void getByKey(com.liyao.protobuf.test.service.MyRequest request,
                         io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getGetByKeyMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void getByKeyServerStream(com.liyao.protobuf.test.service.MyRequest request,
                                     io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncServerStreamingCall(
          getChannel().newCall(getGetByKeyServerStreamMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyRequest> getByKeyClientStream(
        io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncClientStreamingCall(
          getChannel().newCall(getGetByKeyClientStreamMethod(), getCallOptions()), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyRequest> getByKeyBiStream(
        io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getGetByKeyBiStreamMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   */
  public static final class MyServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<MyServiceBlockingStub> {
    private MyServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected MyServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new MyServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.liyao.protobuf.test.service.MyResponse getByKey(com.liyao.protobuf.test.service.MyRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getGetByKeyMethod(), getCallOptions(), request);
    }

    /**
     */
    public java.util.Iterator<com.liyao.protobuf.test.service.MyResponse> getByKeyServerStream(
        com.liyao.protobuf.test.service.MyRequest request) {
      return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
          getChannel(), getGetByKeyServerStreamMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class MyServiceFutureStub extends io.grpc.stub.AbstractFutureStub<MyServiceFutureStub> {
    private MyServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected MyServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new MyServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.liyao.protobuf.test.service.MyResponse> getByKey(
        com.liyao.protobuf.test.service.MyRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getGetByKeyMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_BY_KEY = 0;
  private static final int METHODID_GET_BY_KEY_SERVER_STREAM = 1;
  private static final int METHODID_GET_BY_KEY_CLIENT_STREAM = 2;
  private static final int METHODID_GET_BY_KEY_BI_STREAM = 3;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final MyServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(MyServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @Override
    @SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_BY_KEY:
          serviceImpl.getByKey((com.liyao.protobuf.test.service.MyRequest) request,
              (io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse>) responseObserver);
          break;
        case METHODID_GET_BY_KEY_SERVER_STREAM:
          serviceImpl.getByKeyServerStream((MyRequest) request,
              (io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @Override
    @SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_BY_KEY_CLIENT_STREAM:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getByKeyClientStream(
              (io.grpc.stub.StreamObserver<com.liyao.protobuf.test.service.MyResponse>) responseObserver);
        case METHODID_GET_BY_KEY_BI_STREAM:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getByKeyBiStream(
              (io.grpc.stub.StreamObserver<MyResponse>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class MyServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    MyServiceBaseDescriptorSupplier() {}

    @Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return MyServiceProto.getDescriptor();
    }

    @Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("MyService");
    }
  }

  private static final class MyServiceFileDescriptorSupplier
      extends MyServiceBaseDescriptorSupplier {
    MyServiceFileDescriptorSupplier() {}
  }

  private static final class MyServiceMethodDescriptorSupplier
      extends MyServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    MyServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (MyServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new MyServiceFileDescriptorSupplier())
              .addMethod(getGetByKeyMethod())
              .addMethod(getGetByKeyServerStreamMethod())
              .addMethod(getGetByKeyClientStreamMethod())
              .addMethod(getGetByKeyBiStreamMethod())
              .build();
        }
      }
    }
    return result;
  }
}
